package demo.common.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.*;

/**
 * @author yexi
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommonEntity {
    private Number number;
    private String description;
    private Date createTime;
    private Map<Object, Object> objMap;

    public static CommonEntity buildTestData() {
        CommonEntity commonEntity = new CommonEntity(BigDecimal.valueOf(34.65), "描述", new Date(), Collections.singletonMap("key", true));
        return commonEntity;
    }

    public static List<CommonEntity> buildTestDataList() {
        CommonEntity ce1 = new CommonEntity(BigDecimal.valueOf(34.65), "描述", new Date(), Collections.singletonMap("key", true));
        CommonEntity ce2 = CommonEntity.builder().description("描述2").createTime(new Date()).objMap(Collections.singletonMap("skey", false)).build();
        List<CommonEntity> list = new ArrayList<>();
        list.add(ce1);
        list.add(ce2);
        return list;
    }

}
